<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>server</title>
    <!--<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>-->
    <script src="libs/jquery.min.js"></script>
    <script src="libs/bootstrap.min.js"></script>
    <script src="libs/bootstrap-table.min.js"></script>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-table.min.css">
    <link rel="stylesheet" href="css/jquery-ui.min.css">
    <script>
        function sendMessage() {
            console.log('{"toUserId":"'+$("#toUserId").val()+'","contentText":"'+$("#contentText").val()+'"}');
            var url="http://localhost:8080/push?toUserId="+$("#toUserId").val()+"&message="+$("#contentText").val();
            $.get(url,function(r) {
                console.log("服务端推送返回结果：" + r);
            });
        }
    </script>
</head>
<body>
    <table class="table table-bordered">
        <tbody>
            <tr>
                <td class="text-right col-md-3">【toUserId】：</td>
                <td><input id="toUserId" name="toUserId" type="text" value="102" class="form-control" style="width: 30%;"></td>
            </tr>
            <tr>
                <td class="text-right">【contentText】：</td>
                <td><input id="contentText" name="contentText" type="text" value="公告信息，全体注意！" class="form-control"></td>
            </tr>
            <tr>
                <td class="text-right">【操作】：</td>
                <td><input type="button" onclick="sendMessage()" th:value="发送消息" class="btn btn-primary"/></td>
            </tr>
        </tbody>
    </table>
</body>

</html>